package com.lb.statck.controller;

import com.lb.statck.common.result.R;
import com.lb.statck.pojo.dto.emailDto;
import com.lb.statck.util.MailUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashSet;
import java.util.Set;

@RestController
@RequestMapping("/api/email")
public class sendEmailConreoller {
   @PostMapping("/send")
    public R sendEmail(@RequestBody emailDto emailDto) {

        Set<String> set = new HashSet<>();
        set.add(emailDto.getEmail());
//        set.add("1*******0@qq.com");
        MailUtils.sendEmail(set, "测试发送邮件的接口！",
                "您好！这是我发送的一封测试发送接口的邮件，看完请删除记录。");
        return R.ok();
    }

}
